class Toast {
  static show(message: string, type: 'info' | 'success' | 'error') {
    const toastElement = document.createElement('div')
    toastElement.className = `toast toast-${type}`
    toastElement.textContent = message
    document.body.appendChild(toastElement)

    setTimeout(() => {
      toastElement.remove()
    }, 3000)
  }

  static info(message: string) {
    this.show(message, 'info')
  }

  static success(message: string) {
    this.show(message, 'success')
  }

  static error(message: string) {
    this.show(message, 'error')
  }
}

export default Toast
